|   File        : !Run
|   Date        : 19-Sep-02
|   Description : Script to run !ChangeFSI as a file converter for !PsiFS.
|
|   Copyright  1998, 1999, 2000, 2001, 2002 Alexander Thoukydides
|
|   This program is free software; you can redistribute it and/or
|   modify it under the terms of the GNU General Public License
|   as published by the Free Software Foundation; either version 2
|   of the License, or (at your option) any later version.
|
|   This program is distributed in the hope that it will be useful,
|   but WITHOUT ANY WARRANTY; without even the implied warranty of
|   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|   GNU General Public License for more details.
|
|   You should have received a copy of the GNU General Public License
|   along with this program; if not, write to the Free Software
|   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA

| Generate a friendly error if run without parameters
If "%*0"="" Then Error The ChangeFSI file format converter can only be invoked from within PsiFS

| Ensure that there is sufficient memory to run ChangeFSI
WimpSlot -min 320K -max 508K

| Find ChangeFSI if necessary
If "<ChangeFSI$Dir>"="" Then BASIC -quit <Obey$Dir>.FindFSI { > null: }
If "<ChangeFSI$Dir>"="" Then Error Please open a directory containing !ChangeFSI and then repeat the operation

| Use a temporary alias to remove the "-" prefix from the mode specification
SetEval Alias$PsiFSChangeFSITemp "<ChangeFSI$Dir>.ChangeFSI %0 %1 " + ("%2" RIGHT (LEN "%2" - 1)) + " %*3 -nomode"
PsiFSChangeFSITemp
UnSet Alias$PsiFSChangeFSITemp

| Handle any errors produced
If "<ChangeFSI$ReturnCode>" <> "" Then Error <ChangeFSI$ReturnCode> in ChangeFSI